﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using DemoLib.Shared.Models;

namespace Mvc4Demo.Api
{
    public class InfoController : ApiController
    {
        public InfoController()
        {
            
        }
        // GET api/<controller>
        [Queryable]
        public IEnumerable<News> Get()
        {
            return new List<News>
                {
                    new News{ Id = 1, Heading = "News 1", Detail = "Long news 2 details"},
                    new News{ Id = 1, Heading = "News 2", Detail = "Long news 2 details"}
                };
        }

        // GET api/<controller>/5
        public News Get(int id)
        {
            return new News{ Id =id, Heading = "News 1", Detail = "Long news 2 details"};
        }

        // POST api/<controller>
        public void Post([FromBody]News value)
        {

        }

        // PUT api/<controller>/5
        public void Put(int id, [FromBody]News value)
        {
        }

        // DELETE api/<controller>/5
        public void Delete(int id)
        {

        }
    }
}